In many programming languages, the standard technique for accessing a database is to insert specialized statements into the program. Each specialized statement performs one of several predetermined actions on the database, such as reading from a particular entry, adding a new entry, etc. The most popular language utilized for relational databases is the Structured Query Language (SQL). SQL statements are therefore most often integrated into the code when programming in other programming languages.
FIG. 1 is a block diagram illustrating how typical object-oriented language programs access a SQL database. Each program 100a, 100b, 100c, 100d may incorporate SQL code into their programming. This SQL code then allows the programs 100a, 100b, 100c, 100d to directly access the SQL database 102. An example of such programming might be:
[code to set up the connection]Statement stmt =conection.createStatement ();String query =“SELECT * ” +“FROM TEmployee” +“WHERE TEmployee.getID() = ‘12345’ ”;ResultSet  rs= stmt.executeQuery (query);
This is an example using the Java™ object oriented programming language. As can be seen, SQL statements like “stmt.executeQuery(query)” are directly programmed into the code. This approach has many shortcomings, but these shortcomings are especially relevant when it comes to names of columns in SQL database tables. Researching column names can be difficult and time consuming. This is especially true when the database provider is a different company than that which employs the object-oriented language programmer. The object-oriented language programmer must then communicate with the database provider to learn the different column names. When a column name is changed or added to the database, each of the object oriented language programs accessing the database must be modified. Furthermore, even when all of these procedures are undertaken, programmers with both SQL and object-oriented language expertise are rare.
One solution to this problem might be to represent SQL grammar parts as objects within the object-oriented language programs. However, this approach does not allow for the representation of database tables, columns or names. Another approach might be to create object-oriented language databases as opposed to standard relational databases, storing data in objects instead of tables. This approach has several drawbacks, most notably that SQL databases are quite common and effective, and companies would be reluctant to change to an entirely different class of database. Thus, while object-oriented language databases exist, they are not popular for this reason.
Another potential solution would be to represent tables SQL data as a collection of objects, such as by using Java Data Objects (JDO™). JDO™ represents tables or views as Java classes, but the drawback is that it can't access anything lower than the Java class, and therefore it's not possible to handle column names.
What is needed is a solution which allows object-oriented language programs to access SQL column names without suffering the drawbacks of the prior art.